package com.han.yuhannews.activity;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;

import com.han.yuhannews.R;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.SimpleAdapter;

public class CommentsActivity extends Activity {
	/*
	 新闻回复界面
	 * */
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_comments);
		//测试数据
		List<HashMap<String, String>> comments = new ArrayList<HashMap<String, String>>();
		for (int i = 0; i < 10; i++) {
			HashMap<String, String> hashMap = new HashMap<String, String>();
			hashMap.put("commentator_from", "连云港朋友");
			hashMap.put("comment_ptime", "2012-03-22 20:21:22");
			hashMap.put("comment_content", "这样视频真的太好的！");
			comments.add(hashMap);
		}
		SimpleAdapter commentsAdapter = new SimpleAdapter(this, comments,
				R.layout.adapter_item_comments, new String[] { "commentator_from",
						"comment_ptime", "comment_content" }, new int[] {
						R.id.commentator_from, R.id.comment_ptime,
						R.id.comment_content });

		ListView commentsList = (ListView) findViewById(R.id.comments_list);
		commentsList.setAdapter(commentsAdapter);
	}
}
